package com.example.smartcity1.service.patient;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import com.example.smartcity1.R;

public class PatientClassYesActivity extends AppCompatActivity {

    private TextView patientNameText;
    private TextView categoryNameText;
    private TextView didText;
    private TextView moneyText;
    private TextView dateText;
    private TextView timeText;
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_patient_class_yes);
        ActionBar supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.setTitle("预约单");
            supportActionBar.setDisplayHomeAsUpEnabled(true);
        }
        initView();

        Intent intent = getIntent();
        String patientName = intent.getStringExtra("patientName");
        String categoryName = intent.getStringExtra("categoryName");
        int did = intent.getIntExtra("did",1);
        String money = intent.getStringExtra("money");
        String date = intent.getStringExtra("date");
        String time = intent.getStringExtra("time");


        patientNameText.setText(patientName);
        categoryNameText.setText(categoryName);
        if (did == 1) {
            didText.setText("专家门诊");
        } else if (did == 2){
            didText.setText("普通门诊");
        }
        moneyText.setText(money);
        dateText.setText(date);
        timeText.setText(time);
    }

    @Override
    public boolean onSupportNavigateUp() {
        finish();
        return super.onSupportNavigateUp();
    }

    private void initView() {
        patientNameText = findViewById(R.id.patientName_text);
        categoryNameText = findViewById(R.id.categoryName_text);
        didText = findViewById(R.id.did_text);
        moneyText = findViewById(R.id.money_text);
        dateText = findViewById(R.id.date_text);
        timeText = findViewById(R.id.time_text);
        button = findViewById(R.id.button);
    }
}